import json

import pandas as pd

# 读取Excel文件
file_path = 'D:\\工作文档\舌诊算法\\证型及风险20240507.xlsx'
df = pd.read_excel(file_path, header=0, engine='openpyxl')

# 显示前5行数据
json_data = df.to_json(orient='records', force_ascii=False)
# print(json_data)
array = json.loads(json_data)
# 所有症状集合，之后进行去重
arr_man = []
arr_woman = []
for item in array:
    # 男
    sys_man_list = item['manSymptomDesc'].split("；")
    for s_man in sys_man_list:
        arr_man.append(s_man)

    # 女
    sys_woman_list = item['womanSymptomDesc'].split("；")
    for s_woman in sys_woman_list:
        arr_woman.append(s_woman)

unique_arr = list(set(arr_man))
# print(unique_arr)

unique_woman_arr = list(set(arr_woman))
# print(unique_woman_arr)

merged_list = arr_man + arr_woman
unique_list = list(set(merged_list))
print(unique_list)
